package com.qx.grainmall.elasticsearch.controller;

import com.qx.common.utils.PageUtils;
import com.qx.grainmall.elasticsearch.service.EsService;
import com.qx.grainmall.elasticsearch.service.impl.EsServiceImpl;
import com.qx.grainmall.elasticsearch.vo.Goods;
import com.qx.grainmall.elasticsearch.vo.QueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
@RequestMapping("toes")
public class EsController {
    @Autowired
    private EsService esService;

    @PostMapping("toes")
    public PageUtils<Goods> toeslistss(@RequestBody QueryVo vo,
                                       @RequestParam(value = "page", defaultValue = "1") int page,
                                       @RequestParam(value = "size", defaultValue = "3") int size) throws Exception {
        return esService.toeslist(vo, page, size);
    }
}
